\chapter{User Interface}
In this chapter we will describe the GUI used to interact with the application. We will describe how to process documents and how to search for the information stored in the database.

\section{Overview}
The application GUI can be displayed in any available web browsers due to the features of \emph{Vaadin} framework. The main page is divided into 2 parts, see figure\ref{fig:Pattern}. Section \emph{A} contains controls and allows user to interact with the application, section \emph{B} is used for displaying results.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/application.png}
\caption{Application GUI}
\label{fig:App}
\end{figure}

\section{Triples and terminologies}
Application operates with informations stored in triples and terminologies. The GUI allows user to insert text into Subject, Predicate and Object textual fields and search for triples stored in the database by clicking the \emph{Find Triple} button. The result will then be displayed in the display section \emph{B}. The result will be displayed in a table by clicking any of the cell in the table a pop up window will be displayed with the information about the resource (resource URI, lemma and textual representations). When user presses \emph{Get Detail} button, the application will search for a resource having the written textual representation or lemma and will display the results. \emph{Search Document} will trigger searching for document matching the inserted triple. Triple can have all parts specified or any parts. The result is shown in figure\ref{fig:Pattern}. However this search has been done on terminology, the result would be the same for the triples. Just over the letter \emph{B} is a list containing the documents matching the query. By clicking on any item in the list, it will display the information about the document. First line contains the document name. Button \emph{Download} allows to download the document from the server to the client machine. \emph{See Text} button opens the pop-pup windows that contains the plain text of the document. Under these buttons you can find the statistics about the document. Triples, unique terms (subject, object), unique predicate and terminology counts. Such provided information allows user to see how good the IE on this document was. The document result windows contains two tables. One contains the list of triples extracted from the document and the other contains terminologies with their frequencies an TF-IDF value. By clicking on any of the cells a pop-up window will show the resource informations.
\emph{Get Details and Search Document} buttons has the same effect for terminologies as for triples. By searching using the terminology, the result document list is sorted by the terminology TF-IDF value in the documents.
If we would have filled both, triple parts and terminology, this will trigger searching for document by triple and terminology. The result is then created by disjoin of each result's groups.

\section{Processing documents}
\emph{Select strategy} combo box contains all IE strategies available on the server, if an user would like to create new IE rules, he has to upload this \emph{XML} file on the server by using the File chooser under \emph{Upload Strategy Label}. File chooser under \emph{Upload Document} label allows user to upload a new document on the server and invoke IE on them. Once he will finish uploading the document on the server, he can select this file in the \emph{Select File} combo box and by pressing the \emph{Process Selected File} button invoke the IE. The application then takes the selected rules strategy file, extracts the text from the document, invokes NLP, extracts knowledge and stores it in the database. On success extracted informations and strategies are displayed in a same way as by searching for the document. However if an user would like to extract informations from multiple documents at once, \emph{Vaadin} framework does not support multiple file transfer. Therefore user needs to upload the files into the \url{\\upload\\} folder on the server. And then by using the button \emph{Process Upload Folder}, the applications will start processing each file On success the file is then moved from the upload folder into the \url{\\semjobFiles\\} folder where all documents are stored on the server.

\section{Examples}
To demonstrate our application we will insert some examples. Lets start with the document search based on terminology search, see figure\ref{fig:TermSearch}. We would like to search for a document (documents) that are about filling a reactor. We will insert the text ``\emph{plnění reaktoru}'' into the terminology search text field and press \emph{Search Document} button. The result set is consisted from one file, which contains that king o knowledge. In the result tab we can see the document details. In the terminology table we can find our terminology tab on the top of the terminologies sorted by the relevance. We can assume that there is only one document having this kind of knowledge. Because the TF-IDF is high and we did not get any other results, however the other documents can contain words as ``\emph{plnění}'' and ``\emph{reaktor}'' but only in this document these two words were semantically connected.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/reaktor.png}
\caption{Terminology search result}
\label{fig:TermSearch}
\end{figure}

Another example is about finding a triples that has some missing part. We would like to know, in which triples does a subject ``\emph{trubička}'' appears. See figure\ref{fig:TripleSearch}. We have found that the subject is presented in 6 triples, by writing the missing parts in the empty search text fields we can execute search for the document.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/triples.png}
\caption{Search for missing triple parts}
\label{fig:TripleSearch}
\end{figure}

The last example will show document IE and its results. On the figure\ref{fig:ProcessDoc} we can see that we uploaded and performed processing on the file ``\url{Program_zastupnictvi_MM_ZP_AKP_2010.doc}'' and we have selected ``\url{config_search.xml}'' search configuration. The result of the IE is shown on the ride side in the display part of the GUI. The document does not have that many sentences and the number of extracted triples is not high, however we have managed to extract quite a lot of terminologies and their TF-IDF relevance number shows us, that there is a lot of unique terms describing the document.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/process.png}
\caption{Processing a document}
\label{fig:ProcessDoc}
\end{figure}